
#ifndef __MAIN_UI_H__
#define __MAIN_UI_H__

// -----------------------------------------------------------------------------
// INCLUDES
// -----------------------------------------------------------------------------
#include "./emkit_comm/emkit.h"
#include "app/framework/include/af.h"
#include "app/framework/plugin-soc/connection-manager/connection-manager.h"
#include EMBER_AF_API_BUTTON_INTERFACE
#include EMBER_AF_API_LED_BLINK
#include "util/attribute-storage.h"

#include "./singleBlink_ctl.h"
#include "./scene_config.h"
#include "./battery_ctl.h"
#include "z3_extend/ext_scene.h"
#include "z3_extend/ext_bind.h"
#include "z3_extend/ext_report.h"

// -----------------------------------------------------------------------------
// GLOBAL MACROS
// -----------------------------------------------------------------------------
#define MUC_MAINROUTINE_PERIOD				10			                            // 10ms
#define MUC_NORMALROUTINE_PERIOD 			3600000									// 1h
#define MUC_SYSTEM_INIT_DONE                (1000/MUC_MAINROUTINE_PERIOD)           // 1s
#undef MUC_IAS_ENABLE                                                               // IAS 
#define MUC_DURATION_LEAVE_NWK              5000                                    // 5s
#define MUC_DURATION_JOIN_NWK               3000                                    // 3s
#define MUC_DURATION_MAX_STEERING           175000                                  // 2min55s
#define MUC_DURATION_LIMIT_SCENE_RECALL 	2000 									// 2s
#define MUC_DURATION_LIMIT_SCENE_CONFIG 	180000 									// 3min

#define SAMPLE_SWITCH_ENDPOINT  0x01
#define SAMPLE_SWITCH_KEY2_ENDPOINT  0x02

typedef enum {
    MU_SYSMODE_UNINIT = 0,
    MU_SYSMODE_NORMAL,
    MU_SYSMODE_SPEX_FT,
    MU_SYSMODE_SPEX_ZEROJOIN,
} mu_sysmode_t;

mu_sysmode_t mu_GetSysMode(void);
int mu_writeInstallCode(tokTypeMfgInstallationCode *dat);
int mu_readInstallCode(tokTypeMfgInstallationCode *buffer);
int mu_getTCEui64FromToken(EmberEUI64 bufEui);
int mu_clearTCInfoInToken(void);
int mu_resetBindingTableAndBind2Coor(void);
void printTablesDebug(void);

#endif /* __MAIN_UI_H__ */
